OpenStack Newton : Configure Ceilometer#2
2016/11/01 |
Configure OpenStack Metering Service (Ceilometer).
This example shows to install Metering Services on the existing environment like follows.
For example, install and configure Metering Services on the Network Node. | +------------------+ | +------------------------+ | [ Control Node ] | | | [ Network Node ] | | Keystone |10.0.0.30 | 10.0.0.50| DHCP,L3,L2 Agent | | Glance |------------+------------| Metadata Agent | | Nova API |eth0 | eth0| Ceilometer API/Service | | Neutron Server | | | | +------------------+ | +------------------------+ eth0|10.0.0.51 +--------------------+ | [ Compute Node ] | | Nova Compute | | L2 Agent | | Ceilometer-Compute | +--------------------+ |
Configure Network Node on this section.
|
|
[1] | Install MongoDB which Ceilometer needs for backend database. |
# install from EPEL [root@network ~]# yum --enablerepo=epel -y install mongodb-server mongodb
|
[2] | Configure and Start MongoDB. |
[root@network ~]#
vi /etc/mongod.conf # line 6: change listening range bind_ip = 0.0.0.0
# line 113: uncomment smallfiles = true # create a DataBase for Ceilometer (set any password for "password" section) [root@network ~]# mongo --host 10.0.0.50 --eval ' db = db.getSiblingDB("ceilometer"); db.createUser({user: "ceilometer", pwd: "password", roles: [ "readWrite", "dbAdmin" ]})' MongoDB shell version: 2.6.12 connecting to: 10.0.0.50:27017/test Successfully added user: { "user" : "ceilometer", "roles" : [ "readWrite", "dbAdmin" ] } |
[3] | Install Ceilometer. |
[root@network ~]# yum --enablerepo=centos-openstack-newton,epel -y install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm python2-ceilometerclient python2-oslo-policy httpd mod_wsgi
|
[4] | Configure Ceilometer. |
[root@network ~]# mv /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf.org
[root@network ~]#
vi /etc/ceilometer/ceilometer.conf # create new
[DEFAULT]
rpc_backend = rabbit auth_strategy = keystone
[api]
port = 8777 host = 0.0.0.0 # MongoDB connection info [database] connection = mongodb://ceilometer:password@10.0.0.50:27017/ceilometer # RabbitMQ connection info [oslo_messaging_rabbit] rabbit_host = 10.0.0.30 rabbit_port = 5672 rabbit_userid = openstack rabbit_password = password # Keystone auth info [keystone_authtoken] auth_uri = http://10.0.0.30:5000 auth_url = http://10.0.0.30:35357 memcached_servers = 10.0.0.30:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = ceilometer password = servicepassword # Ceilometer auth info [service_credentials] auth_url = http://10.0.0.30:5000/v3 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = ceilometer password = servicepassword interface = internalURL region_name = RegionOne chgrp ceilometer /etc/ceilometer/ceilometer.conf [root@network ~]# chmod 640 /etc/ceilometer/ceilometer.conf |
[5] | If SELinux is enabled, change policy like follows. |
[root@network ~]# setsebool -P httpd_use_openstack on [root@network ~]# setsebool -P httpd_can_network_connect on [root@network ~]# setsebool -P httpd_can_network_connect_db on [root@network ~]# semanage port -a -t http_port_t -p tcp 8777 |
[6] | If Firewalld is running, allow ports like follows. |
[root@network ~]# firewall-cmd --add-port={8777/tcp,27017/tcp} --permanent success [root@network ~]# firewall-cmd --reload success |
[7] | Configure httpd. |
[root@network ~]#
vi /etc/httpd/conf.d/wsgi-ceilometer.conf # create new like follows Listen 8777 <VirtualHost *:8777> WSGIDaemonProcess ceilometer-api processes=2 threads=10 user=ceilometer group=ceilometer display-name=%{GROUP} WSGIProcessGroup ceilometer-api WSGIScriptAlias / "/var/www/cgi-bin/ceilometer/app" WSGIApplicationGroup %{GLOBAL} ErrorLog /var/log/httpd/ceilometer_error.log CustomLog /var/log/httpd/ceilometer_access.log combined </VirtualHost> WSGISocketPrefix /var/run/httpd mkdir /var/www/cgi-bin/ceilometer [root@network ~]# cp /usr/lib/python2.7/site-packages/ceilometer/api/app.wsgi /var/www/cgi-bin/ceilometer/app [root@network ~]# systemctl start httpd [root@network ~]# systemctl enable httpd
|
[8] | Start Ceilometer services. |
[root@network ~]# systemctl start openstack-ceilometer-notification \ openstack-ceilometer-central \ openstack-ceilometer-collector [root@network ~]# systemctl enable openstack-ceilometer-notification \ openstack-ceilometer-central \ openstack-ceilometer-collector |